﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:p="clr-namespace:Lithnet.Acma.Presentation"
                    xmlns:a="clr-namespace:Lithnet.Acma;assembly=Lithnet.Acma"
                    xmlns:c="clr-namespace:Lithnet.MetadirectoryServices;assembly=Lithnet.MetadirectoryServices"
                    xmlns:fim="clr-namespace:Microsoft.MetadirectoryServices;assembly=Microsoft.MetadirectoryServicesEx"
                    xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation">

    <DataTemplate  DataType="{x:Type p:AcmaInternalExitEventViewModel}">
        <StackPanel>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Label Content="Event Name"
                       Grid.Row="0"
                       Grid.Column="0"
                       Margin="2" />
                <TextBox Text="{Binding Path=Id, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="0"
                         Grid.Column="1"
                         Margin="2" />

                <CheckBox Content="Event is disabled"
                          IsChecked="{Binding Path=IsDisabled}"
                          VerticalAlignment="Center"
                          Grid.Row="1"
                          Grid.Column="1"
                          Margin="2" />
            </Grid>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition MaxWidth="30" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Label Content="Available Recipients"
                       Grid.Row="0"
                       Grid.Column="0"
                       Margin="2" />

                <Label Content="Selected Recipients"
                       Grid.Row="0"
                       Grid.Column="2"
                       Margin="2" />

                <ListBox ItemsSource="{Binding Path=AllowedRecipients,Mode=OneWay}"
                         DisplayMemberPath="Name"
                         Grid.Row="1"
                         Grid.Column="0"
                         MaxHeight="300"
                         ScrollViewer.VerticalScrollBarVisibility="Auto"
                         Margin="2">
                    <ListBox.Resources>

                        <Style TargetType="{x:Type ListBoxItem}">
                            <Setter Property="IsSelected"
                                    Value="{Binding Path=IsSelected, Mode=TwoWay}" />
                        </Style>
                    </ListBox.Resources>
                </ListBox>

                <StackPanel Grid.Row="1"
                            Grid.Column="1"
                            Margin="5,0,5,0">
                    <Button Content="&gt;"
                            Command="{Binding Path=Commands.Add}" />
                    <Button Content="&lt;"
                            Command="{Binding Path=Commands.Remove}" />
                </StackPanel>

                <ListBox ItemsSource="{Binding Path=Recipients,Mode=OneWay}"
                         DisplayMemberPath="Name"
                         Grid.Row="1"
                         Grid.Column="2"
                         MaxHeight="300"
                         ScrollViewer.VerticalScrollBarVisibility="Auto"
                         Margin="2">
                    <ListBox.Resources>
                        <Style TargetType="{x:Type ListBoxItem}">
                            <Setter Property="IsSelected"
                                    Value="{Binding Path=IsSelected, Mode=TwoWay}" />
                        </Style>
                    </ListBox.Resources>
                </ListBox>
            </Grid>
        </StackPanel>
    </DataTemplate>

</ResourceDictionary>